package com.dk.controller;

import com.dk.em.Result;
import com.dk.service.generateCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("generateCode")
public class generateController {

    @Autowired
    private generateCodeService generateCodeService;

//    WAREHOUSE_CODE ：固定字符
//    ITEM_TYPE_CODE  ：流水号
//    TASK_CODE      ：日期

    @GetMapping
    public Result generateCode(@RequestParam String codename){
        System.out.println(codename);       //注意：记得将RCode   PCode服务启起来
        String code = generateCodeService.selectCode(codename);
        return Result.OK().setData(code);
    }
}
